using System.Security.AccessControl;

namespace CSharpPro._0930;

public class Demo
{
    /*public void TestPrint()
    {
        int x=int.Parse(Console.ReadLine());
        int y=int.Parse(Console.ReadLine());
        int z=int.Parse(Console.ReadLine());
        
        int []a=new int[3];
        a[0]=x;
        a[1]=y;
        a[2]=z;
        Array.Sort(a);
        Console.WriteLine(string.Join(",", a));
    }*/

    /*
    public void TestPrint2()
    {
        int sum = 0;
        for (int i = 1; i <= 100; i++)
        {
            
            int g = i % 10;
            int s = i / 10;
            if (i % 7 == 0 || g==7||s==7)
            {
                continue;
            }
            sum += i;
            Console.WriteLine(i);    
            
        }

        Console.WriteLine("和："+sum);
    }*/

   
   public void TestPrint3()
   {
       int k = 1;
       for (int i = 1; i <= 9; i++)
       {
           for (int j = 1; j <= k; j++)
           {
               Console.Write(j+"X"+i+"="+i*j);
               Console.Write(" ");
           }
           Console.WriteLine();
           k++;
       }
       
   }

   public void TestPrint4()
   {
       Console.WriteLine("1000以内所有完数为：");
       for (int i = 1; i < 1000; i++)
       {
           int sum = 0;
           for (int j = 1; j <i ; j++)
           {
               if (i % j == 0)
               {
                   sum += j;
               }
           }

           if (i == sum)
           {
               Console.WriteLine(i);
           }
       }
   }

   public void TestPrint5()
   {
       int z=int.Parse(Console.ReadLine());
       int sum=0;
       int reverse=0;
       int b=z, a;
       while (z != 0)
       {
            a = z % 10;
            z = z / 10;
            reverse=reverse*10+a;
            sum++;
       }

       Console.WriteLine(b+"是"+sum+"位数  逆序为："+reverse);
   }

   public void TestPrint6()
   {
       int h=int.Parse(Console.ReadLine());
       int n = 0,n2=0;
       for (int k = h/2+1; k >= 1; k--)
       {
           for (int i = 1; i <=k-1 ; i++)
           {
               Console.Write(" ");
           }
           
           for (int i = 1; i <= 2 *n + 1; i++)
           {
               Console.Write("*");
           }
           n++; 
           n2 = n-1;

           for (int i = 1; i <=k-1 ; i++)
           {
               Console.Write(" ");
           }
           Console.WriteLine();
       }
       
      
       for (int k = 1; k <=h/2 ; k++)
       {
           for (int i = 1; i <=k ; i++)
           {
               Console.Write(" ");
           }
           
           for (int i =2*n2-1 ; i >=1; i--)
           {
               Console.Write("*");
           }
           n2--;

           for (int i = 1; i <=k ; i++)
           {
               Console.Write(" ");
           }
           Console.WriteLine();
       }
   }
   
}